package cn.topcodes.tcsf.admin.domain.form;

import cn.topcodes.tcsf.admin.commons.domain.Idable;
import lombok.Data;
import java.util.Date;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 限流规则表单
 * @author Unicorn
 * @date 2018-03-08 12:23:12
 */
@Data
public class RatelimiterRuleForm implements Idable {
	
	private Long id;

	@NotNull(message = "每秒产生许可数量不能为空")
	private Double permitsPerSecond;
	
	@NotNull(message = "每次获取许可数量不能为空")
	private Integer acquirePermits;
	
	private Long warmupPeriod;
	
	@Length(min = 0,max = 20,message = "预热时间单位长度为0~20个字符")
	private String warmupTimeUnit;
	
	@NotNull(message = "尝试获取不能为空")
	private Boolean isTry = false;
	
	private Long timeout;
	
	@Length(min = 0,max = 20,message = "超时时间单位长度为0~20个字符")
	private String timeoutUnit;
	
	@NotNull(message = "URI不能为空")
	@Length(min = 0,max = 1000,message = "URI长度为0~1000个字符")
	private String uri;
	

}